package org.springblade.modules.system.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * @Description
 * @Author ysq
 * @Date 2022/5/12
 **/
@Data
public class SimpleUserVO {

	@ApiModelProperty(value = "用户id")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long userId;

	@ApiModelProperty(value = "用户名称")
	private String userName;

	@ApiModelProperty(value = "用户手机号")
	private String phone;

	@ApiModelProperty(value = "头像")
	private String avatar;

	@ApiModelProperty(value = "用户公众号openid")
	private String openid;

	@ApiModelProperty(value = "用户app")
	private String registrationId;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		SimpleUserVO that = (SimpleUserVO) o;
		return userId.equals(that.userId) && userName.equals(that.userName);
	}

	@Override
	public int hashCode() {
		return Objects.hash(userId, userName);
	}
}
